Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Getting an API-key when provided only username and password #9

Merged
merged 1 commit into from
Jan 29, 2021

Conversation

kafouros
Copy link
Contributor

No description provided.

Talento90
Talento90 previously approved these changes Jan 27, 2021
Copy link
Contributor

@Talento90 Talento90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM just some minor comments! 👍

package.json Outdated
@@ -1,7 +1,7 @@
{
"displayName": "GlueHome Homebridge Plugin",
"name": "@gluehome/homebridge-gluehome",
"version": "0.1.3",
"version": "0.1.4",
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It should be "0.2.0"

@@ -1,6 +1,19 @@
import axios, { AxiosInstance } from "axios"
import { Lock, LockOperation, CreateLockOperation } from "./"


export async function issueApiKey(username: string, password: string): Promise<string> {
let response = await axios.post("https://user-api.gluehome.com/v1/api-keys", {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we add the api Url as constant?

const API_URL = 'https://user-api.gluehome.com';

let response = await axios.post(`{API_URL}/v1/api-keys`...

Add BasicAuth scheme alternative through configuration.
Graceful handling of 503 (lock busy) errors.
Increase polling frequency during a lock operation.
Copy link
Contributor

@Talento90 Talento90 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@kafouros kafouros merged commit e8319a5 into master Jan 29, 2021
@kafouros kafouros deleted the user-credentials branch January 29, 2021 13:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants